# create_expert_trajectory
# create_expert_trajectory_from_file
# from the spock library
import sys, os, json
import copy
import random
from tqdm import tqdm
import numpy as np

from pathlib import Path
from PIL import Image
from matplotlib import pyplot as plt
import networkx as nx
import ai2thor.controller

sys.path.append(str(Path(__file__).parent.parent))
from typing import Any, Optional

import gym

import prior
from ai2thor.controller import Controller
from ai2thor.platform import CloudRendering
from allenact.base_abstractions.sensor import Sensor
from allenact.base_abstractions.task import EnvType, SubTaskType
from allenact.utils.misc_utils import prepare_locals_for_super



from third_party.spoc_robot_training.environment import stretch_controller
from third_party.spoc_robot_training.tasks import abstract_task,object_nav_task

# build task 


expert_args = {
    "initialize_controller": True,
    "grid_size": 0.15,
    "include_move_left_right": False,
    "datasets": "procthor-10k",
    "agentMode": "stretch",
    "mode": "val",
    "platform": CloudRendering,
    "scene": prior.load_dataset("procthor-10k")["val"][random.randint(0, len(prior.load_dataset("procthor-10k")["val"]) - 1)],
}


Expert = stretch_controller.StretchController(**expert_args)

